import types from './types'

export default {
  [types.SET_SN](state, sn) {
    state.sn = sn
  },
  [types.SET_LOGIN_USER](state, loginUser) {
    state.loginUser = loginUser
  },
  [types.SET_LOGIN_USER](state, loginUser) {
    state.loginUser = loginUser
  },
  [types.SET_ROLE](state, role) {
    state.role = role
  },
  [types.SET_USER_INFO](state, userInfo) {
    state.userInfo = userInfo
  },
  [types.INIT_USER](state) {
    state.sn = ''
    state.userInfo = null
    state.loginUser = null
    state.role = null
  }
}
